package com.fd.cloud.fdftp.controller;

import com.fd.cloud.fdftp.util.FtpUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RequestMapping("/api/fpt")
@RestController
public class FtpController {

    @Autowired
    FtpUtils ftpUtils;

    @RequestMapping
    public String select(){
        try {
            ftpUtils.getFTPClient();
            ftpUtils.getFTPClient();
            ftpUtils.getFTPClient();
        } catch (Exception e) {
            e.printStackTrace();
        }
        /*for (int i = 0; i < 10; i++) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    try {
                        ftpUtils.getFTPClient();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }).start();
        }*/
        return "";
    }
}
